<template>
  <div class="video" v-if="props.info.video && props.info.video.url">
    <div class="mask-layer" @click="videoplay">
      <div class="round">
        <span v-if="!store.videoInfoShow" class="freeIcon">&#xe672;</span><span v-else class="freeIcon">&#xe671;</span>
      </div>
    </div>
    <!-- <video id="myVideo" class="outline-cover" :src="urls + props.info.video.url"></video> -->
    <PlayVideo :isDel="true" :info="props.info" :url="props.info.video.url" />
  </div>
</template>
<script lang="ts">
export default defineComponent({
  name: 'videoview',
});
</script>

<script setup lang="ts">
import PlayVideo from '@/components/video/playVideo.vue';
import { useProjectStore } from '@/store';
import { urls } from '@/utils/request/upload';
import { defineComponent } from 'vue';

const store = useProjectStore();
const props = defineProps({
  info: {
    type: Object,
    default: () => {},
  },
});
store.videoInfoUrl = props.info;
const videoplay = () => {
  store.videoInfoShow = true;
  store.videoInfoUrl = props.info;
};
</script>

<style scoped lang="less">
.video {
  width: 100%;
  height: 100%;
  position: relative;
  .mask-layer {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    position: absolute;
    top: 50%;
    transform: translate(0%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    .round {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      border: 2px solid rgba(236, 235, 231, 1);
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
      .freeIcon {
        font-size: 24px;
        line-height: 38px;
        color: rgba(236, 235, 231, 1);
      }
    }
  }
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  ::v-deep .video-boxs {
    width: 100%;
    height: 100%;
    padding: 0;
    background: transparent;
  }
  ::v-deep .video-boxs-img {
    width: 100%;
    height: 100%;
  }
  ::v-deep .player {
    display: none;
  }
  ::v-deep .video-boxs .video-boxs-img .video-boxs-content[data-v-47b0f5b3] {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
</style>